import java.io.*;

public class BRRead {
    public static void main(String args[]) throws IOException {
        int b;
        b = 'A';
        System.out.write(b);
        System.out.write('\n');

        try {
            byte[] bWrite = {11, 21, 3, 40, 5};
            OutputStream os = new FileOutputStream("read.txt");
        /*for (int x = 0; x < bWrite.length; x++) {
            os.write(bWrite[x]); // writes the bytes
        }*/
            for (byte element : bWrite) {
                os.write(element);// writes the bytes
            }
            os.close();

            InputStream is = new FileInputStream("read.text");
            int size = is.available();

            for (int i = 0; i < size; i++) {
                System.out.print((char) is.read() + " ");
            }
            is.close();
        } catch (IOException e) {
            System.out.println("Exception Found!");
        }


        /*char c;
        // 使用 System.in 创建
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        System.out.println("输入字符, 按下 'q' 键退出。");
        // 读取字符串
        do {
            c = (char) br.read();
            System.out.println(c);
        } while (c != 'q');*/

//        String str;
//        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
//        System.out.println("输入字符, 按下 'end' 键退出。");
//
//        do {
//            str = (String) br.readLine();
//            System.out.println(str);
//        } while (!str.equals("end"));
    }
}
